home *** CD-ROM | disk | FTP | other *** search
- SPREAD(3I) Last changed: 1-6-98
-
-
- NNAAMMEE
- SSPPRREEAADD - Constructs an array from several copies of an actual argument
-
- SSYYNNOOPPSSIISS
- SSPPRREEAADD (([SSOOUURRCCEE==]_s_o_u_r_c_e,, [DDIIMM==]_d_i_m,, [NNCCOOPPIIEESS==]_n_c_o_p_i_e_s))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- SSTTAANNDDAARRDDSS
- Fortran 90
-
- DDEESSCCRRIIPPTTIIOONN
- The SSPPRREEAADD intrinsic function constructs an array from several copies
- of an actual argument. This intrinsic function can be used for array
- construction. It replicates an array by adding a dimension. It
- broadcasts several copies of _s_o_u_r_c_e along a specified dimension and
- thus forms an array of rank one greater. SSPPRREEAADD accepts the following
- arguments:
-
- _s_o_u_r_c_e May be of any type. It may be scalar or array valued. The
- rank of _s_o_u_r_c_e must be less than 7.
-
- _d_i_m Must be scalar and an integer with value in the range of
- 1 <= _d_i_m <= _n + 1, where _n is the rank of _s_o_u_r_c_e. This
- function does a check on _d_i_m.
-
- _n_c_o_p_i_e_s Must be scalar and an integer.
-
- SSPPRREEAADD is a transformational intrinsic function. The name of this
- intrinsic cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result is an array of the same type as _s_o_u_r_c_e and of rank _n+1,
- where _n is the rank of _s_o_u_r_c_e.
-
- If _s_o_u_r_c_e is scalar, the shape of the result is MMAAXX((_n_c_o_p_i_e_s,,00)). If
- _s_o_u_r_c_e is array valued with shape
- (_d , _d , ..., _d ),
- 1 2 _n
- the shape of the result is
- (_d , _d , ..., _d , MMAAXX(_n_c_o_p_i_e_s, 0), _d , ..., _d ).
- 1 2 _d_i_m-1 _d_i_m _n
-
- If _s_o_u_r_c_e is scalar, each element of the result has a value equal to
- _s_o_u_r_c_e.
-
- If _s_o_u_r_c_e is array valued, the element of the result with subscripts
- (_r , _r , ..., _r )
- 1 2 _n+1
- has the value
- _s_o_u_r_c_e(_r , _r , ..., _r , _r , ..., _r )).
- 1 2 _d_i_m-1 _d_i_m+1 _n+1
-
- EEXXAAMMPPLLEESS
- Example 1: Assume that IISSCCAALLRR is the scalar value of 8. The
- following statements are then true:
-
- * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 00)) is a zero-sized
- array.
-
- * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 22)) is [8, 8].
-
- Example 2: Assume that AA is the array [2, 3, 4]. The following
- statements are then true:
-
- * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 00 )) is a zero-sized
- array.
-
- * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 33 )) is as follows:
-
- | 2 3 4 |
-
- | 2 3 4 |
-
- | 2 3 4 |
-
- * The value of SSPPRREEAADD(( AA,, DDIIMM == 22,, NNCCOOPPIIEESS == 33 )) is as follows:
-
- | 2 2 2 |
-
- | 3 3 3 |
-
- | 4 4 4 |
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
- printed version of this man page.
-
-